package com.xiahui.day10.TestSuper.Test1;

class Animal {
    String name;
    int age;

    public Animal(String name, int age) {
        this.name = name;
        this.age = age;
        System.out.println("Animal 构造方法被调用");
    }
}

class Dog extends Animal {
    String breed;

    public Dog(String name, int age, String breed) {
        super(name, age); // 调用父类的构造方法
        this.breed = breed;
        System.out.println("Dog 构造方法被调用");
    }

    public static void main(String[] args) {
        Dog dog = new Dog("Buddy", 3, "Golden Retriever");
    }
}
